package com.mask.im.business.common.exception;


import com.mask.im.business.enums.StatusCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.io.Serializable;

/**
 * @author jian
 */
@Getter
@AllArgsConstructor
public class BusinessException extends RuntimeException implements Serializable{

	private Integer code= StatusCodeEnum.FAIL.getCode();

	private String reason;

	public BusinessException(StatusCodeEnum statusCodeEnum){
		this.code = statusCodeEnum.getCode();
		this.reason = statusCodeEnum.getDesc();
	}

	public BusinessException(String cause){
		this.reason = cause;
	}
}
